<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/8
 * Time: 10:23
 */
namespace app\api\controller;

use app\api\model\BusinessModel;
class Business extends Base
{
    /**
     * 商家列表
     */
    public function businessList(){
        $param = request()->param();
        $page = $param['page']??1;
        $model = new BusinessModel();
        $data = $model->getList($page);
        output($data,1,'');
    }

    /**
     * 商家列表搜索功能
     */
    public function searchList(){
        $param = request()->param();
        $key = $param['key']??'';
        $model = new BusinessModel();
        if(empty($key)){
            //未输入搜索条件
            $data = $model->getList(1);
        }else{
            //输入了搜索条件
            $data = $model->searchList($key);
        }

    }
}